Integrand size = 17, antiderivative size = 120 \[ \int x^m \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {2 b^2 n^2 x^{1+m}}{(1+m) \left ((1+m)^2+4 b^2 n^2\right )}+\frac {(1+m) x^{1+m} \cos ^2\left (a+b \log \left (c x^n\right )\right )}{(1+m)^2+4 b^2 n^2}+\frac {2 b n x^{1+m} \cos \left (a+b \log \left (c x^n\right )\right ) \sin \left (a+b \log \left (c x^n\right )\right )}{(1+m)^2+4 b^2 n^2} \]
2*b^2*n^2*x^(1+m)/(1+m)/((1+m)^2+4*b^2*n^2)+(1+m)*x^(1+m)*cos(a+b*ln(c*x^n ))^2/((1+m)^2+4*b^2*n^2)+2*b*n*x^(1+m)*cos(a+b*ln(c*x^n))*sin(a+b*ln(c*x^n ))/((1+m)^2+4*b^2*n^2)
Result contains complex when optimal does not.
Time = 0.36 (sec) , antiderivative size = 91, normalized size of antiderivative = 0.76 \[ \int x^m \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {x^{1+m} \left (1+2 m+m^2+4 b^2 n^2+(1+m)^2 \cos \left (2 \left (a+b \log \left (c x^n\right )\right )\right )+2 b (1+m) n \sin \left (2 \left (a+b \log \left (c x^n\right )\right )\right )\right )}{2 (1+m) (1+m-2 i b n) (1+m+2 i b n)} \]
(x^(1 + m)*(1 + 2*m + m^2 + 4*b^2*n^2 + (1 + m)^2*Cos[2*(a + b*Log[c*x^n]) ] + 2*b*(1 + m)*n*Sin[2*(a + b*Log[c*x^n])]))/(2*(1 + m)*(1 + m - (2*I)*b* n)*(1 + m + (2*I)*b*n))
Time = 0.24 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {4991, 15}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int x^m \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx\) |
\(\Big \downarrow \) 4991 |
\(\displaystyle \frac {2 b^2 n^2 \int x^mdx}{4 b^2 n^2+(m+1)^2}+\frac {(m+1) x^{m+1} \cos ^2\left (a+b \log \left (c x^n\right )\right )}{4 b^2 n^2+(m+1)^2}+\frac {2 b n x^{m+1} \sin \left (a+b \log \left (c x^n\right )\right ) \cos \left (a+b \log \left (c x^n\right )\right )}{4 b^2 n^2+(m+1)^2}\) |
\(\Big \downarrow \) 15 |
\(\displaystyle \frac {(m+1) x^{m+1} \cos ^2\left (a+b \log \left (c x^n\right )\right )}{4 b^2 n^2+(m+1)^2}+\frac {2 b n x^{m+1} \sin \left (a+b \log \left (c x^n\right )\right ) \cos \left (a+b \log \left (c x^n\right )\right )}{4 b^2 n^2+(m+1)^2}+\frac {2 b^2 n^2 x^{m+1}}{(m+1) \left (4 b^2 n^2+(m+1)^2\right )}\) |
(2*b^2*n^2*x^(1 + m))/((1 + m)*((1 + m)^2 + 4*b^2*n^2)) + ((1 + m)*x^(1 + m)*Cos[a + b*Log[c*x^n]]^2)/((1 + m)^2 + 4*b^2*n^2) + (2*b*n*x^(1 + m)*Cos [a + b*Log[c*x^n]]*Sin[a + b*Log[c*x^n]])/((1 + m)^2 + 4*b^2*n^2)
3.2.25.3.1 Defintions of rubi rules used
Int[(a_.)*(x_)^(m_.), x_Symbol] :> Simp[a*(x^(m + 1)/(m + 1)), x] /; FreeQ[ {a, m}, x] && NeQ[m, -1]
Int[Cos[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(d_.)]^(p_)*((e_.)*(x_))^(m_. ), x_Symbol] :> Simp[(m + 1)*(e*x)^(m + 1)*(Cos[d*(a + b*Log[c*x^n])]^p/(b^ 2*d^2*e*n^2*p^2 + e*(m + 1)^2)), x] + (Simp[b*d*n*p*(e*x)^(m + 1)*Sin[d*(a + b*Log[c*x^n])]*(Cos[d*(a + b*Log[c*x^n])]^(p - 1)/(b^2*d^2*e*n^2*p^2 + e* (m + 1)^2)), x] + Simp[b^2*d^2*n^2*p*((p - 1)/(b^2*d^2*n^2*p^2 + (m + 1)^2) ) Int[(e*x)^m*Cos[d*(a + b*Log[c*x^n])]^(p - 2), x], x]) /; FreeQ[{a, b, c, d, e, m, n}, x] && IGtQ[p, 1] && NeQ[b^2*d^2*n^2*p^2 + (m + 1)^2, 0]
Time = 5.16 (sec) , antiderivative size = 83, normalized size of antiderivative = 0.69
method | result | size |
parallelrisch | \(\frac {\left (4 b^{2} n^{2}+2 \left (1+m \right ) b n \sin \left (2 b \ln \left (c \,x^{n}\right )+2 a \right )+\left (1+m \right )^{2} \left (\cos \left (2 b \ln \left (c \,x^{n}\right )+2 a \right )+1\right )\right ) x^{1+m}}{2 \left (4 b^{2} n^{2}+m^{2}+2 m +1\right ) \left (1+m \right )}\) | \(83\) |
1/2*(4*b^2*n^2+2*(1+m)*b*n*sin(2*b*ln(c*x^n)+2*a)+(1+m)^2*(cos(2*b*ln(c*x^ n)+2*a)+1))*x^(1+m)/(4*b^2*n^2+m^2+2*m+1)/(1+m)
Time = 0.25 (sec) , antiderivative size = 105, normalized size of antiderivative = 0.88 \[ \int x^m \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {2 \, {\left (b m + b\right )} n x x^{m} \cos \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) \sin \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) + {\left (2 \, b^{2} n^{2} x + {\left (m^{2} + 2 \, m + 1\right )} x \cos \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{2}\right )} x^{m}}{m^{3} + 4 \, {\left (b^{2} m + b^{2}\right )} n^{2} + 3 \, m^{2} + 3 \, m + 1} \]
(2*(b*m + b)*n*x*x^m*cos(b*n*log(x) + b*log(c) + a)*sin(b*n*log(x) + b*log (c) + a) + (2*b^2*n^2*x + (m^2 + 2*m + 1)*x*cos(b*n*log(x) + b*log(c) + a) ^2)*x^m)/(m^3 + 4*(b^2*m + b^2)*n^2 + 3*m^2 + 3*m + 1)
\[ \int x^m \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx=\begin {cases} \log {\left (x \right )} \cos ^{2}{\left (a \right )} & \text {for}\: b = 0 \wedge m = -1 \\\int x^{m} \cos ^{2}{\left (- a + \frac {i m \log {\left (c x^{n} \right )}}{2 n} + \frac {i \log {\left (c x^{n} \right )}}{2 n} \right )}\, dx & \text {for}\: b = - \frac {i \left (m + 1\right )}{2 n} \\\int x^{m} \cos ^{2}{\left (a + \frac {i m \log {\left (c x^{n} \right )}}{2 n} + \frac {i \log {\left (c x^{n} \right )}}{2 n} \right )}\, dx & \text {for}\: b = \frac {i \left (m + 1\right )}{2 n} \\\frac {\begin {cases} \log {\left (x \right )} \cos {\left (2 a \right )} & \text {for}\: b = 0 \wedge \left (b = 0 \vee n = 0\right ) \\\log {\left (x \right )} \cos {\left (2 a + 2 b \log {\left (c \right )} \right )} & \text {for}\: n = 0 \\\frac {\sin {\left (2 a + 2 b \log {\left (c x^{n} \right )} \right )}}{2 b n} & \text {otherwise} \end {cases}}{2} + \frac {\log {\left (x \right )}}{2} & \text {for}\: m = -1 \\\frac {2 b^{2} n^{2} x x^{m} \sin ^{2}{\left (a + b \log {\left (c x^{n} \right )} \right )}}{4 b^{2} m n^{2} + 4 b^{2} n^{2} + m^{3} + 3 m^{2} + 3 m + 1} + \frac {2 b^{2} n^{2} x x^{m} \cos ^{2}{\left (a + b \log {\left (c x^{n} \right )} \right )}}{4 b^{2} m n^{2} + 4 b^{2} n^{2} + m^{3} + 3 m^{2} + 3 m + 1} + \frac {2 b m n x x^{m} \sin {\left (a + b \log {\left (c x^{n} \right )} \right )} \cos {\left (a + b \log {\left (c x^{n} \right )} \right )}}{4 b^{2} m n^{2} + 4 b^{2} n^{2} + m^{3} + 3 m^{2} + 3 m + 1} + \frac {2 b n x x^{m} \sin {\left (a + b \log {\left (c x^{n} \right )} \right )} \cos {\left (a + b \log {\left (c x^{n} \right )} \right )}}{4 b^{2} m n^{2} + 4 b^{2} n^{2} + m^{3} + 3 m^{2} + 3 m + 1} + \frac {m^{2} x x^{m} \cos ^{2}{\left (a + b \log {\left (c x^{n} \right )} \right )}}{4 b^{2} m n^{2} + 4 b^{2} n^{2} + m^{3} + 3 m^{2} + 3 m + 1} + \frac {2 m x x^{m} \cos ^{2}{\left (a + b \log {\left (c x^{n} \right )} \right )}}{4 b^{2} m n^{2} + 4 b^{2} n^{2} + m^{3} + 3 m^{2} + 3 m + 1} + \frac {x x^{m} \cos ^{2}{\left (a + b \log {\left (c x^{n} \right )} \right )}}{4 b^{2} m n^{2} + 4 b^{2} n^{2} + m^{3} + 3 m^{2} + 3 m + 1} & \text {otherwise} \end {cases} \]
Piecewise((log(x)*cos(a)**2, Eq(b, 0) & Eq(m, -1)), (Integral(x**m*cos(-a + I*m*log(c*x**n)/(2*n) + I*log(c*x**n)/(2*n))**2, x), Eq(b, -I*(m + 1)/(2 *n))), (Integral(x**m*cos(a + I*m*log(c*x**n)/(2*n) + I*log(c*x**n)/(2*n)) **2, x), Eq(b, I*(m + 1)/(2*n))), (Piecewise((log(x)*cos(2*a), Eq(b, 0) & (Eq(b, 0) | Eq(n, 0))), (log(x)*cos(2*a + 2*b*log(c)), Eq(n, 0)), (sin(2*a + 2*b*log(c*x**n))/(2*b*n), True))/2 + log(x)/2, Eq(m, -1)), (2*b**2*n**2 *x*x**m*sin(a + b*log(c*x**n))**2/(4*b**2*m*n**2 + 4*b**2*n**2 + m**3 + 3* m**2 + 3*m + 1) + 2*b**2*n**2*x*x**m*cos(a + b*log(c*x**n))**2/(4*b**2*m*n **2 + 4*b**2*n**2 + m**3 + 3*m**2 + 3*m + 1) + 2*b*m*n*x*x**m*sin(a + b*lo g(c*x**n))*cos(a + b*log(c*x**n))/(4*b**2*m*n**2 + 4*b**2*n**2 + m**3 + 3* m**2 + 3*m + 1) + 2*b*n*x*x**m*sin(a + b*log(c*x**n))*cos(a + b*log(c*x**n ))/(4*b**2*m*n**2 + 4*b**2*n**2 + m**3 + 3*m**2 + 3*m + 1) + m**2*x*x**m*c os(a + b*log(c*x**n))**2/(4*b**2*m*n**2 + 4*b**2*n**2 + m**3 + 3*m**2 + 3* m + 1) + 2*m*x*x**m*cos(a + b*log(c*x**n))**2/(4*b**2*m*n**2 + 4*b**2*n**2 + m**3 + 3*m**2 + 3*m + 1) + x*x**m*cos(a + b*log(c*x**n))**2/(4*b**2*m*n **2 + 4*b**2*n**2 + m**3 + 3*m**2 + 3*m + 1), True))
Leaf count of result is larger than twice the leaf count of optimal. 646 vs. \(2 (120) = 240\).
Time = 0.28 (sec) , antiderivative size = 646, normalized size of antiderivative = 5.38 \[ \int x^m \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx=\text {Too large to display} \]
1/4*(((cos(4*b*log(c))*cos(2*b*log(c)) + sin(4*b*log(c))*sin(2*b*log(c)) + cos(2*b*log(c)))*m^2 + 2*(cos(4*b*log(c))*cos(2*b*log(c)) + sin(4*b*log(c ))*sin(2*b*log(c)) + cos(2*b*log(c)))*m + 2*(b*cos(2*b*log(c))*sin(4*b*log (c)) - b*cos(4*b*log(c))*sin(2*b*log(c)) + (b*cos(2*b*log(c))*sin(4*b*log( c)) - b*cos(4*b*log(c))*sin(2*b*log(c)) + b*sin(2*b*log(c)))*m + b*sin(2*b *log(c)))*n + cos(4*b*log(c))*cos(2*b*log(c)) + sin(4*b*log(c))*sin(2*b*lo g(c)) + cos(2*b*log(c)))*x*x^m*cos(2*b*log(x^n) + 2*a) - ((cos(2*b*log(c)) *sin(4*b*log(c)) - cos(4*b*log(c))*sin(2*b*log(c)) + sin(2*b*log(c)))*m^2 + 2*(cos(2*b*log(c))*sin(4*b*log(c)) - cos(4*b*log(c))*sin(2*b*log(c)) + s in(2*b*log(c)))*m - 2*(b*cos(4*b*log(c))*cos(2*b*log(c)) + b*sin(4*b*log(c ))*sin(2*b*log(c)) + (b*cos(4*b*log(c))*cos(2*b*log(c)) + b*sin(4*b*log(c) )*sin(2*b*log(c)) + b*cos(2*b*log(c)))*m + b*cos(2*b*log(c)))*n + cos(2*b* log(c))*sin(4*b*log(c)) - cos(4*b*log(c))*sin(2*b*log(c)) + sin(2*b*log(c) ))*x*x^m*sin(2*b*log(x^n) + 2*a) + 2*((cos(2*b*log(c))^2 + sin(2*b*log(c)) ^2)*m^2 + 4*(b^2*cos(2*b*log(c))^2 + b^2*sin(2*b*log(c))^2)*n^2 + 2*(cos(2 *b*log(c))^2 + sin(2*b*log(c))^2)*m + cos(2*b*log(c))^2 + sin(2*b*log(c))^ 2)*x*x^m)/((cos(2*b*log(c))^2 + sin(2*b*log(c))^2)*m^3 + 3*(cos(2*b*log(c) )^2 + sin(2*b*log(c))^2)*m^2 + 4*(b^2*cos(2*b*log(c))^2 + b^2*sin(2*b*log( c))^2 + (b^2*cos(2*b*log(c))^2 + b^2*sin(2*b*log(c))^2)*m)*n^2 + 3*(cos(2* b*log(c))^2 + sin(2*b*log(c))^2)*m + cos(2*b*log(c))^2 + sin(2*b*log(c)...
Leaf count of result is larger than twice the leaf count of optimal. 8742 vs. \(2 (120) = 240\).
Time = 0.70 (sec) , antiderivative size = 8742, normalized size of antiderivative = 72.85 \[ \int x^m \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx=\text {Too large to display} \]
-1/4*(8*b^2*n^2*x*abs(x)^m*tan(b*n*log(abs(x)) + b*log(abs(c)))^2*tan(1/4* pi*m*sgn(x) - 1/4*pi*m)^2*tan(a)^2 - 4*b*m*n*x*abs(x)^m*e^(pi*b*n*sgn(x) - pi*b*n + pi*b*sgn(c) - pi*b)*tan(b*n*log(abs(x)) + b*log(abs(c)))^2*tan(1 /4*pi*m*sgn(x) - 1/4*pi*m)^2*tan(a) - 4*b*m*n*x*abs(x)^m*e^(-pi*b*n*sgn(x) + pi*b*n - pi*b*sgn(c) + pi*b)*tan(b*n*log(abs(x)) + b*log(abs(c)))^2*tan (1/4*pi*m*sgn(x) - 1/4*pi*m)^2*tan(a) + 4*b*m*n*x*abs(x)^m*e^(pi*b*n*sgn(x ) - pi*b*n + pi*b*sgn(c) - pi*b)*tan(b*n*log(abs(x)) + b*log(abs(c)))^2*ta n(1/4*pi*m*sgn(x) - 1/4*pi*m)*tan(a)^2 - 4*b*m*n*x*abs(x)^m*e^(-pi*b*n*sgn (x) + pi*b*n - pi*b*sgn(c) + pi*b)*tan(b*n*log(abs(x)) + b*log(abs(c)))^2* tan(1/4*pi*m*sgn(x) - 1/4*pi*m)*tan(a)^2 - 4*b*m*n*x*abs(x)^m*e^(pi*b*n*sg n(x) - pi*b*n + pi*b*sgn(c) - pi*b)*tan(b*n*log(abs(x)) + b*log(abs(c)))*t an(1/4*pi*m*sgn(x) - 1/4*pi*m)^2*tan(a)^2 - 4*b*m*n*x*abs(x)^m*e^(-pi*b*n* sgn(x) + pi*b*n - pi*b*sgn(c) + pi*b)*tan(b*n*log(abs(x)) + b*log(abs(c))) *tan(1/4*pi*m*sgn(x) - 1/4*pi*m)^2*tan(a)^2 + m^2*x*abs(x)^m*e^(pi*b*n*sgn (x) - pi*b*n + pi*b*sgn(c) - pi*b)*tan(b*n*log(abs(x)) + b*log(abs(c)))^2* tan(1/4*pi*m*sgn(x) - 1/4*pi*m)^2*tan(a)^2 + m^2*x*abs(x)^m*e^(-pi*b*n*sgn (x) + pi*b*n - pi*b*sgn(c) + pi*b)*tan(b*n*log(abs(x)) + b*log(abs(c)))^2* tan(1/4*pi*m*sgn(x) - 1/4*pi*m)^2*tan(a)^2 + 8*b^2*n^2*x*abs(x)^m*tan(b*n* log(abs(x)) + b*log(abs(c)))^2*tan(1/4*pi*m*sgn(x) - 1/4*pi*m)^2 - 4*b*n*x *abs(x)^m*e^(pi*b*n*sgn(x) - pi*b*n + pi*b*sgn(c) - pi*b)*tan(b*n*log(a...
Time = 27.27 (sec) , antiderivative size = 82, normalized size of antiderivative = 0.68 \[ \int x^m \cos ^2\left (a+b \log \left (c x^n\right )\right ) \, dx=\frac {x\,x^m}{2\,m+2}+\frac {x\,x^m\,{\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\left (c\,x^n\right )}^{b\,2{}\mathrm {i}}}{4\,m+4+b\,n\,8{}\mathrm {i}}+\frac {x\,x^m\,{\mathrm {e}}^{-a\,2{}\mathrm {i}}\,\frac {1}{{\left (c\,x^n\right )}^{b\,2{}\mathrm {i}}}\,1{}\mathrm {i}}{m\,4{}\mathrm {i}+8\,b\,n+4{}\mathrm {i}} \]